﻿using K9Nano.Application.Dtos;
using K9Nano.Domain.Entities;

namespace K9Nano.Application;

public interface ICurdAppServiceBase<TEntity, in TCreateDto, in TEditDto, TItemDto, in TQueryDto>
    where TEntity : class, IEntity
    where TEditDto : IKeyDto
    where TQueryDto : IPagedQueryDto<TEntity>
{
    Task<TItemDto> CreateAsync(TCreateDto createDto, CancellationToken cancellation);

    Task<TItemDto?> GetAsync(long id, CancellationToken cancellation);

    Task<TItemDto> UpdateAsync(TEditDto updateDto, CancellationToken cancellation);

    Task<bool> DeleteAsync(long id, CancellationToken cancellation);

    Task<PagedResultDto<TItemDto>> QueryAsync(TQueryDto queryDto, CancellationToken cancellation);

    Task<IEnumerable<TItemDto>> GetAllAsync(CancellationToken cancellation);
}

